package it.greg.findparty.util.map;

import java.util.Map;
import java.util.TreeMap;

public class MapUtil {
	
	public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue( Map<K, V> map ){
		ValueComparator<K,V> bvc =  new ValueComparator<K,V>(map);
		TreeMap<K,V> sorted_map = new TreeMap<K,V>(bvc);
		sorted_map.putAll(map);
		return sorted_map;
	}

}
